<?php
class Request{
	
	static function setVar($name,$value,$method=null){
		switch($method){
			case "post":
				$_POST[$name]=$value;
				$_REQUEST[$name]=$value;
				break;
			case "get":
				$_GET[$name]=$value;
				$_REQUEST[$name]=$value;
				break;
			default:
				//May need to set all depends on required functionality(Can't decide)
				$_REQUEST[$name]=$value;
				break;
		}
	}
	
	static function getVar($name,$default=null,$method=null){
			switch($method){
				case "post":
					if(isset($_POST[$name]))
						return $_POST[$name];
					break;
				case "get":
					if(isset($_GET[$name]))
					return $_GET[$name];
					break;
				default:
					//May need to set all depends on required functionality(Can't decide)
					if(isset($_REQUEST[$name]))
					return $_REQUEST[$name];
					break;
			}
			return $default;
	}
	
	static function get($array=null){
		switch($array){
			case "post":
			return $_POST;
			case "get":
			return $_GET;
			default:
			return $_REQUEST;
		}
		return false;
	}
	
	static function setArray($array,$method=null){
		if(!is_array($array)) return false;
		switch($method){
			case "post":
				foreach($array as $key=>$value)
					$_POST[$key]=$value;
				break;
			case "get":
				foreach($array as $key=>$value)
					$_GET[$key]=$value;
				break;
			default:
				foreach($array as $key=>$value)
					$_REQUEST[$key]=$value;
				break;
		}
		return true;
	}
}

?>